money = 300
goods = {"鞋子": 100, "衣服": 200, "帽子": 50}
shopping_cart = []
print("请问您要购买什么商品？（输入商品名称）")

while True:
    good = input()
    if good in goods:
        if money >= goods[good]:
            money -= goods[good]
            shopping_cart.append(good)
            print(f"恭喜，购买成功！您的卡余额还剩{money}")
        else:
            print("穷鬼，钱不够！请到其他超市购买！")
    else:
        print("没有这个商品，别瞎弄！")

    print("输入Q/q 退出,打印购物小条；")
    if input().upper() == "Q":
        print("\n购物小条：")
        for item in shopping_cart:
            print(f"{item}: {goods[item]}元")
        print(f"卡内余额: {money}元")
        break